const express = require('express')
const router = express.Router()

const user = require('./sql/login.js')
const menu = require('./fs/getmenu.js')
const goods = require('./sql/goodlist.js')
const category = require('./sql/getcategory.js')
const userlist = require('./sql/userlist.js')
const orderlist = require('./sql/orderlist.js')
const grouplist = require('./sql/grouplist.js')

router.get('/user',user.check)
router.get('/menu',menu.send)
router.get('/goods',goods.all)
router.get('/searchgood',goods.search)
router.get('/setnewgood',goods.addnew)
router.get('/updategood',goods.updateold)
//商品的单行删除和多行删除的功能有待验证
router.get('/delsinglegood',goods.singledel)
router.get('/delanygoods',goods.delanylines)
//分类表
router.get('/getcategory',category.tollevel)
router.get('/getpardata',category.parlevel)
router.get('/getlastdata',category.lastlevel)
//用户表
router.get('/userdata',userlist.all)
router.get('/searchuser',userlist.search)
router.get('/setnewuser',userlist.setnew)
router.get('/updateuser',userlist.updataold)
//订单列表
router.get('/orderlist',orderlist.all)
router.get('/searchorder',orderlist.search)
router.get('/setlistgroup',orderlist.sethandledata)
//订单清单
router.get('/getgrouplist',grouplist.all)
router.get('/searchgroup',grouplist.search)

module.exports = router